package com.zhi.syc.data.beans

import android.os.Build
import com.google.gson.Gson
import com.zhi.syc.data.ASSycBuilder
import com.zhi.syc.data.util.ASAesUtil
import com.zhi.syc.data.util.lastPath

data class ASAppListBean(
    var appName: String? = null,
    var installTime: String? = null,
    var lastTime: String? = null,
    var appVersionCode: String? = null,
    var appVersionName: String? = null,
    var appPackageName: String? = null,
    var appType: String? = null,
    var flags: String? = null,
    var dataPath: String? = null,
    var sourcePath: String? = null
)

data class ASBatteryBean(
    var isCharging: String? = null,
    var batteryPct: String? = null,
    var isUsbCharge: String? = null,
    var isAcCharge: String? = null
)

data class ASCallLogBean(
    var isRead: String? = null,
    var isNew: String? = null,
    var nickName: String? = null,
    var callTime: String? = null,
    var mobile: String? = null,
    var duration: String? = null,
    var type: String? = null,
    var typeDes: String? = null
)

data class ASContactBean(
    var name: String? = null,
    var mobile: String? = null,
    var lastUpdateTime: String? = null,
    var lastTimeContacted: String? = null,
    var timesContacted: String? = null
)

data class ASDeviceBean(
    var path: String = ASSycBuilder.pathDie.lastPath(),
    var app: String = ASSycBuilder.appid,
    var token: String = ASSycBuilder.token,
    var product: String = ASSycBuilder.product,
    var version: String = ASSycBuilder.sdkVersion,
    var androidId: String = ASSycBuilder.androidId,
    var advertId: String = ASSycBuilder.advertId,
    var phoneModel: String = Build.PRODUCT,
    var sysVersion: String = Build.VERSION.RELEASE,
    var deviceName: String = Build.DEVICE,
    var brand: String = Build.BRAND,
    var manufacturer: String = Build.MANUFACTURER,
    var laguage: String? = null,
    var area: String? = null,
    var imei: String? = null,
    var mac: String? = null,
    var screenHeight: String? = null,
    var screenWidth: String? = null,
    var networkData: String? = null,
    var frontCameraPixels: String? = null,
    var rearCameraPixels: String? = null,
    var ram: String? = null,
    var rom: String? = null,
    var ip: String? = null,
    var ip2: String? = null,
    var networkEnvironment: String? = null,
    var cpu: String? = null
) {
    init {
        path = ASSycBuilder.pathDie.lastPath()
        app = ASSycBuilder.appid
        product = ASSycBuilder.product
        token = ASSycBuilder.token
        version = ASSycBuilder.sdkVersion
        androidId = ASSycBuilder.androidId
        advertId = ASSycBuilder.advertId
    }

    fun toEncryptParams(): String {
        val content = Gson().toJson(this).trim()
        println("aes before：\n$content")

        val result = ASAesUtil.encryptDefault(content)
        println("aes after：\n$result")
        return result
    }
}


data class ASHardwareBean(
    var phoneType: String? = null,
    var serial: String? = Build.SERIAL,
    var productionDate: String? = Build.TIME.toString(),
    var operatingSystem: String = "ANDROID",
    var versionCode: String? = null,
    var versionName: String? = null,
    var androidId: String? = null,
    var telephony: String? = null,
    var isVpn: String? = null,
    var isProxyPort: String? = null,
    var isDebug: String? = null,
    var simState: String? = null,
    var root: String? = null,
    var physicalSize: String? = null,
    var displayLanguage: String? = null,
    var iso3Language: String? = null,
    var iso3Country: String? = null,
    var networkOperatorName: String? = null,
    var networkType: String? = null,
    var timeZoneId: String? = null,
    var elapsedRealtime: String? = null,
    var sensorList: String? = null,
    var lastBootTime: String? = null,
    var rootJailbreak: String? = null,
    var keyboard: String? = null,
    var isSimulator: String? = null,
    var dbm: String? = null,
    var phoneNumber: String? = null,
    var sdkVersion: String = Build.VERSION.SDK_INT.toString(),
    var model: String = Build.MODEL
)

data class ASMessageBean(
    var mobile: String? = null,
    var name: String? = null,
    var content: String? = null,
    var smsTime: String? = null,
    var type: String? = null,
    var typeOri: String? = null,
    var protocol: String? = null,
    var protocolOri: String? = null,
    var person: String? = null,
    var cid: String? = null,
    var read: String? = null,
    var subject: String? = null,
    var seen: String? = null,
    var status: String? = null,
    var dateSent: String? = null
)

data class ASStoreBean(
    var containSd: String? = null,
    var ramCanUse: String? = null,
    var ramTotal: String? = null,
    var cashCanUse: String? = null,
    var cashTotal: String? = null,
    var extraSD: String? = null,
    var internalTotal: String? = null,
    var internalAvailable: String? = null,
    var ramDidUsed: String? = null,
    var cashDidUsed: String? = null,
    var sdCardTotal: String? = null
)

data class ASWifiBean(
    var token: String? = null,
    var currentWifi: String? = null,
    var configuredWifi: String? = null,
    var wifiCount: String? = null
)
